<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script src="./js/jquery.fullscreen.js"></script>
  <style>
    html {
      height: 100%;
    }
    
    body {
      height: 100%;
      margin: 0;
      padding: 0;
      background-color: yellow;
    }
  </style>
</head>

<body>
  <button>fullscreen</button>
  <button>unfullscreen</button>
  <script>
    // $('button:first').click(function() {
    //   $('body').fullScreen(true)
    // })
    // $('button:last').click(function() {
    //   $('body').fullScreen(false)
    // })
    $('button:first').click(function() {
      if (document.webkitFullscreenEnabled) {
        document.documentElement.webkitRequestFullscreen()
      }
    });
    $('button:last').click(function() {
      if (document.webkitFullscreenEnabled) {
        document.webkitExitFullscreen()
      }
    })
  </script>
</body>

</html>